<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Content-Language" content="zh-CN">
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
</head>
<body>

<!-- 加入js库 -->
<script src="./nodeuuid.js"></script>

<div id="divid">
	<p>哈喽</p>
	<p>世界</p>
</div>	
<script type="text/javascript">
	var div = document.getElementById('divid');
	var childNodes = div.childNodes;
	//console.log(childNodes);
	for(var i = 0; i<childNodes.length; i++){
		if(childNodes[i].nodeName.indexOf('#') == 0){
			//排除如 #text 这种的，只留正常的 tag 标签的
			continue;
		}
		console.log('----------------');
		console.log('uuid : '+nodeuuid.uuid(childNodes[i]));
		console.log(childNodes[i]);
	}
</script>

<div style="position: absolute; bottom:20px; text-align:center; width:100%">开源仓库及文档地址： https://github.com/xnx3/nodeuuid.js</div>
</body>
</html>